<?php
class Grid_Customer_Customer extends OeZend_Widget_Grid {
    public function init() {

        $collectionColumn = new OeZend_Widget_Grid_Collection_Column();

        $idColumn = new OeZend_Widget_Grid_Column('id');
        $idColumn->setFilter('Combobox');
        $idColumn->addAttribute(array('class' => 'center', 'width' => '4%'));

        $titleColumn = new OeZend_Widget_Grid_Column('full_name');
        $titleColumn->setLabel('Full name');

        $acountColumn = new OeZend_Widget_Grid_Column();
        $acountTmp = '<a href="mailto:${email}" target="_blank">${email}</a>';
        $acountColumn->setContent(new OeZend_Widget_Grid_Column_Content_Template($acountTmp));
        $acountColumn->setLabel('Email');

        $phoneColumn = new OeZend_Widget_Grid_Column('phone');
        $phoneColumn->setLabel('Phone');

        $addressColumn = new OeZend_Widget_Grid_Column('address');
        $addressColumn->setLabel('Address');

        $viewColumn = new OeZend_Widget_Grid_Column();
        $viewColumn->setLabel('View');
        $link = '<a href="/admin/customer/view/id/${id}"><i class="icon-list-alt"></i></a>';
        $viewColumn->setContent(new OeZend_Widget_Grid_Column_Content_Template($link));
        $viewColumn->addAttribute(array('class' => 'center', 'width' => '4%'));

        $linkColumn = new OeZend_Widget_Grid_Column();
        $linkColumn->setLabel('Edit');
        $link = '<a href="/admin/customer/update/id/${id}"><i class="icon-list-alt"></i></a>';
        $linkColumn->setContent(new OeZend_Widget_Grid_Column_Content_Template($link));
        $linkColumn->addAttribute(array('class' => 'center', 'width' => '4%'));

        $linkDeleteColumn = new OeZend_Widget_Grid_Column();
        $linkDeleteColumn->setLabel('Delete');
        $linkDelete = '<a href="/admin/customer/delete/id/${id}" class="must-confirm"><i class="icon-remove"></i></a>';
        $linkDeleteColumn->setContent(new OeZend_Widget_Grid_Column_Content_Template($linkDelete));
        $linkDeleteColumn->addAttribute(array('class' => 'center', 'width' => '4%'));

        $collectionColumn->addColumns(
                  array(
                        $idColumn,
                        $titleColumn,
                        $acountColumn,
                        $phoneColumn,
                        $viewColumn,
                        $linkColumn,
                        $linkDeleteColumn
                       ));

        $this->setCollectionColumn($collectionColumn);
    }
}


